{% extends './layout.html.twig' %}

{% block title %}{{ symbol }} | Trading View | Crypto Bot{% endblock %}

{% block content %}
    <div class="content-wrapper">
        <section class="content-header">
            <div class="container-fluid">
                <div class="row mb-2">
                    <div class="col-sm-6">
                        <h1>Trading View</h1>
                    </div>
                    <div class="col-sm-6">
                        <ol class="breadcrumb float-sm-right">
                            <li class="breadcrumb-item"><a href="/">Dashboard</a></li>
                            <li class="breadcrumb-item active">Tradingview</li>
                        </ol>
                    </div>
                </div>
            </div>
        </section>

        <div class="content">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-sm">
                        <div id="tradingview" style="width: 100%; height: 600px"></div>
                    </div>
                    <div class="col-sm">
                        <div id="tradingview_2" style="width: 100%; height: 600px"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
{% endblock %}


{% block javascript %}
<script type="text/javascript" src="https://s3.tradingview.com/tv.js"></script>


  <script type="text/javascript">
  new TradingView.widget(
    {
      "autosize": true,
      "symbol": "{{ symbol }}",
            "interval": "15",
            "theme": "Light",
            "style": "1",
            "locale": "en",
            "toolbar_bg": "#f1f3f6",
            "enable_publishing": false,
            "allow_symbol_change": true,
            "container_id": "tradingview",
            "timezone": Intl.DateTimeFormat().resolvedOptions().timeZone,
            "studies": [
                "BB@tv-basicstudies",
                "CCI@tv-basicstudies",
                "MACD@tv-basicstudies",
                "MAExp@tv-basicstudies",
                "RSI@tv-basicstudies",
                "StochasticRSI@tv-basicstudies"
            ],
        }
    );

    new TradingView.widget(
        {
            "autosize": true,
            "symbol": "{{ symbol }}",
            "interval": "60",
            "theme": "Light",
            "style": "1",
            "locale": "en",
            "toolbar_bg": "#f1f3f6",
            "enable_publishing": false,
            "allow_symbol_change": true,
            "container_id": "tradingview_2",
            "timezone": Intl.DateTimeFormat().resolvedOptions().timeZone,
            "studies": [
                "BB@tv-basicstudies",
                "CCI@tv-basicstudies",
                "MACD@tv-basicstudies",
                "MAExp@tv-basicstudies",
                "RSI@tv-basicstudies",
                "StochasticRSI@tv-basicstudies"
            ],
        }
    );
</script>
{% endblock javascript %}